import request from '@/config/axios'

export interface ContractVO {
  id: number
  type: boolean
  sn: string
  userId: number
  companyId: number
  projectId: number
  userSign: string
  companySign: string
  body: string
  endTime: Date
  status: boolean
}

// 查询合同管理列表
export const getContractPage = async (params) => {
  return await request.get({ url: `/system/contract/page`, params })
}

// 查询合同管理详情
export const getContract = async (id: number) => {
  return await request.get({ url: `/cms/contract/get?id=` + id })
}

// 新增合同管理
export const createContract = async (data: ContractVO) => {
  return await request.post({ url: `/cms/contract/create`, data })
}

// 修改合同管理
export const updateContract = async (data: ContractVO) => {
  return await request.put({ url: `/cms/contract/update`, data })
}

// 删除合同管理
export const deleteContract = async (id: number) => {
  return await request.delete({ url: `/cms/contract/delete?id=` + id })
}

// 导出合同管理 Excel
export const exportContract = async (params) => {
  return await request.download({ url: `/cms/contract/export-excel`, params })
}
